
#ifndef els_heap_h
#define els_heap_h


#include "els_object.h"
#include "els_vmhost.h"

#define incr_top {if (L->top == L->stack_last) els_Heap_checkstack(L, 1); L->top++;}


void els_Heap_init (els_VmObj *L, int stacksize);
void els_Heap_adjusttop (els_VmObj *L, Els_vminline_obj base, int extra);
void els_Heap_call (els_VmObj *L, Els_vminline_obj func, int nResults);

void els_Heap_checkstack (els_VmObj *L, int n);

void els_Heap_breakrun (els_VmObj *L, int errcode);
int els_Heap_runprotected (els_VmObj *L, void (*f)(els_VmObj *, void *), void *ud);


#endif
